package com.baidu.infinity.ui.fragment.home.shape.shapes

import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Path
import android.os.Build
import androidx.annotation.RequiresApi
import com.baidu.infinity.ui.fragment.home.shape.BaseShape

class TriangleShape: BaseShape() {

    @RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM)
    override fun draw(canvas: Canvas) {
        super.draw(canvas)
        mPath.reset()
        mPath.moveTo(startX,endY)
        mPath.lineTo(endX,endY)
        mPath.lineTo((startX + endX) / 2,startY)
        mPath.close()
        canvas.drawPath(mPath,mPaint)
    }
}